﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin.master" AutoEventWireup="true" CodeFile="Lottery.aspx.cs" Inherits="SY.WebSite.Web.View.Auction" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>列表管理 - 抽奖管理 - 后台管理系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />    
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.css" rel="stylesheet" type="text/css" />
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/skin/default/main.css" rel="stylesheet" type="text/css" />
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/utility.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-ajaxupload/jquery.ajaxupload.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/jquery.ui.uapselector.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <div>
	    <h1>
		    <small>抽奖管理</small>
	    </h1>
    </div>
    <form class="form-search">
        <fieldset>
            状态：
            <select id="spstatus" style="width:120px">
                <option value="100">全部</option>
                <option value="0">进行中</option>
                <option value="1">待开奖</option>
                <option value="2">已结束</option>
            </select>
            主题：<input class="input" id="title" type="text" placeholder="主题"/>
	        <label class="type right">时间段：</label>
            <input id="start" type="text" class="Wdate date" placeholder="开始时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{$dp.$D(\'end\')}'})"/>&nbsp; 
            - &nbsp;<input id="end" type="text" class="Wdate date" placeholder="结束时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'start\')}'})"/>
            <button type="button" class="btn" onclick="page.getList(0)">查询</button>
        </fieldset>
    </form>
    <div id="result"></div>
    <div id="pagination"></div>
    <textarea name="auctionlist" id="auctionlist" style="display:none;"> 
    <table class="table table-hover table-striped">
		<thead>
			<tr>
				<th>状态</th><th class="span4">主题</th><th>结束时间</th><th>参与者最低可用素币</th><th>扣除可用素币</th>
                <th>参与人数</th><th>抽中池</th><th>抽不中池</th><th>&nbsp;</th>
            </tr>
        </thead>
		<tbody>
            {for p in list}
			<tr>
                <td>@{page.tStatus(p.Status, p.OpenTime)}</td>
                <td>
                    <p><img src="@{p.Image}" alt="@{p.Title}" class="img-rounded" style="height:212px; width:420px;" /></p>
                    <blockquote>
                        <p>@{p.Title}</p>
                        <small>创建者：@{p.UserName} 创建时间：@{p.CreateTime.ToDate().Format('yyyy-MM-dd hh:mm')}</small>
                    </blockquote>
                </td>
                <td>@{p.OpenTime.ToDate().Format('yyyy-MM-dd hh:mm')}</td>
                <td>@{p.LimitAmount}</td>
                <td>@{p.CostAmount}</td>
                <td>@{page.joinCount(p.Participants)}</td>
                <td>@{page.showList(p.Lucky)}</td>
                <td>@{page.showList(p.Forbidden)}</td>
                <td>
                    {if p.Status ==0}
                    <div class="btn-group">
                        <a class="btn" href="#">操作</a>
                        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            {if p.OpenTime.ToDate() > new Date()}
                            <li><a href="javascript:void(0)" onclick="page.edit(@{p.Id})">编辑基本信息</a></li>
                            {if p.Participants == undefined || p.Participants ==""}
                            <li><a href="javascript:void(0)" onclick="page.cancel(@{p.Id})">删除</a></li>
                            {/if}
                            {else}
                            <li><a href="javascript:void(0)" onclick="page.setWhiteList(@{p.Id})">设置抽中池</a></li>
                            <li><a href="javascript:void(0)" onclick="page.setBlackList(@{p.Id})">设置抽不中池</a></li>
                            {/if}
                        </ul>
                    </div>
                    {/if}
                </td>
			</tr>
            {forelse}
            <tr><td colspan="6">暂无相关数据</td></tr>
            {/for}
		</tbody>
	</table>
    </textarea>

    <textarea name="detail" id="detail" style="display:none;"> 
    <div class="row">
        <form class="form-horizontal">
            <div class="control-group">
                <label class="control-label" for="utitle">主题</label>
                <div class="controls  controls-row">
                     <span id="spnTitle"></span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="ulogo">Logo</label>
                <div class="controls">
                    <input value="@{Image}"  id="ulogo" placeholder="输入url地址或者上传本地图片" type="text" required/>
                    <button class="btn" type="button" id="upload">上传本地图片</button> (建议图片大小为 212px*420px)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="uend">结束时间</label>
                <div class="controls">
                    <input id="uend" type="text" value="@{OpenTime.ToDate().Format('yyyy-MM-dd hh:mm')}" class="Wdate date" placeholder="结束时间" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"/>
                </div>
            </div>
            <div class="control-group" style="clear:both">
                <label class="control-label"></label>
                <div class="controls">
                    <button type="button" class="btn btn-info" id="btnEdit">提交</button>
                </div>
            </div>
        </form>
    </div>
    </textarea>

    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/admin/lottery.js" type="text/javascript"></script>
    <script type="text/javascript">
        page.userList =<%= ToJson(UserList) %>;
    </script>
</asp:Content>